{ Siberian Olympiad. 3 stage.
  Problemset: http://agul-problems1.googlecode.com/svn/trunk/2010-2011/wso/stage3/wso_3stage.pdf
  Problem 1
  Points: 100
}
{$APPTYPE CONSOLE}
uses sysutils;
var n,c,x,y,i,r,count,j,k,cur,m,first:longint; s,t:string; a,v:array[1..20] of longint; h,res:array[1..1000000] of longint; can,bad:boolean;
procedure qsort(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=h[(l+r) div 2];
repeat
  while h[i]<x do inc(i);
  while h[j]>x do dec(j);
  if i<=j then begin
    y:=h[i];
    h[i]:=h[j];
    h[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(s);
fillchar(a,sizeof(a),0); 
fillchar(v,sizeof(v),0);
n:=0;
c:=0;
while length(s)>0 do begin
  inc(n);
  if pos(' ',s)<>0 then t:=copy(s,1,pos(' ',s)-1) else t:=s;
  if t='*' then begin
    inc(c);
    v[c]:=n;
    a[n]:=117;
  end else a[n]:=strtoint(t);
  if pos(' ',s)<>0 then delete(s,1,pos(' ',s)) else s:='';
end;
x:=0;
y:=0;
i:=1;
count:=0;
while (x=0) or (y=0) do begin
  if (a[i]<>117) then
    if x=0 then x:=i else y:=i;
  inc(i);
end;
if a[x]<a[y] then begin
  for i := 0 to 100 do begin
    r:=a[x];
    cur:=a[x];
    first:=a[x];
    can:=true;
    bad:=false;
    for j := x-1 downto 1 do begin
      if a[j]=117 then begin
        dec(cur,i);
        inc(r,cur);
      end else   
      if a[j]=cur+i then begin
        cur:=a[j];
        inc(r,cur);
      end else
      if can and (a[j]<>cur-i) then begin
        dec(cur,i);
        inc(r,cur);
        dec(cur,i);
        can:=false;
        if a[j]=cur then inc(r,cur) else begin
          bad:=true;
          break;
        end;
      end else begin
        bad:=true;
        break;
      end;
      if not bad and (j=1) then first:=cur;
    end;
    if not bad then begin
      cur:=a[x];
      for j := x+1 to n do begin
        if a[j]=117 then begin
          inc(cur,i);
          inc(r,cur);
        end else 
        if a[j]=cur+i then begin
          cur:=a[j];
          inc(r,cur);
        end else
        if can and (a[j]<>cur+i) then begin
          inc(cur,i);
          inc(r,cur);
          inc(cur,i);
          can:=false;
          if a[j]=cur then inc(r,cur) else begin
            bad:=true;
            break;
          end;
        end else begin
          bad:=true;
          break;
        end;
      end;
      if not bad then begin
        if not can then begin
          inc(count);
          h[count]:=r;
        end else begin
          inc(count,2);
          h[count]:=r+cur+i;
          h[count-1]:=r+first-i;
        end;
      end;
    end;
  end;
end else begin
  for i := 0 downto -100 do begin
    r:=a[x];
    cur:=a[x];
    first:=a[x];
    can:=true;
    bad:=false;
    for j := x-1 downto 1 do begin
      if a[j]=117 then begin
        dec(cur,i);
        inc(r,cur);
      end else 
      if a[j]=cur+i then begin
        cur:=a[j];
        inc(r,cur);
      end else
      if can and (a[j]<>cur-i) then begin
        dec(cur,i);
        inc(r,cur);
        dec(cur,i);
        can:=false;
        if a[j]=cur then inc(r,cur) else begin
          bad:=true;
          break;
        end;
      end else begin
        bad:=true;
        break;
      end;
      if not bad and (j=1) then first:=CUR;
    end;
    if not bad then begin
      cur:=a[x];
      for j := x+1 to n do begin 
        if a[j]=117 then begin
          inc(cur,i);
          inc(r,cur);
        end else
        if a[j]=cur+i then begin
          cur:=a[j];
          inc(r,cur);
        end else
        if can and (a[j]<>cur+i) then begin
          inc(cur,i);
          inc(r,cur);
          inc(cur,i);
          can:=false;
          if a[j]=cur then inc(r,cur) else begin
            bad:=true;
            break;
          end;
        end else begin
          bad:=true;
          break;
        end;
      end;
      if not bad then begin
        if not can then begin
          inc(count);
          h[count]:=r;
        end else begin
          inc(count,2);
          h[count]:=r+cur+i;
          h[count-1]:=r+first-i;
        end;
      end;
    end;
  end;
end;
if count>1 then qsort(1,count);
i:=2;
c:=h[1];
if count>0 then begin
  res[1]:=c;
  m:=count;
  r:=1;
end;
while i<=m do begin
  if h[i]<>c then begin
    c:=h[i];
    inc(r);
    res[r]:=c;
  end;
  inc(i);
end;
if r>0 then
  for I := 1 to r do write(res[i],' ');
end.